package com.huabo.contract.mysql.mapper;

import com.huabo.contract.mysql.entity.TblCirculationMySql;

import java.util.List;

import org.apache.ibatis.annotations.*;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2021-10-28
 */
public interface TblCirculationMySqlMapper extends BaseMapper<TblCirculationMySql> {


	@InsertProvider(method="saveTblCirculationnew",type=TblCirculationMySqlMapperSqlConfig.class)
	@Options(useGeneratedKeys=true, keyProperty="cyid", keyColumn="CYID")
	TblCirculationMySql saveTblCirculationnew(String type, String number, String name, String url, String loginUser,String buskey,String definitionId,String taskid) throws Exception;

	@Select("select * from TBL_CIRCULATION where TASKID = #{taskid}  limit =1")
	TblCirculationMySql selectCiculaInfoById(@Param("taskid")Integer taskid) throws Exception;

	@UpdateProvider(method="updateCirculationInfoById",type=TblCirculationMySqlMapperSqlConfig.class)
	void updateCirculationInfoById(TblCirculationMySql circulation);

	@Select("select * from TBL_CIRCULATION where TASKID = #{taskId}")
    List<TblCirculationMySql> findByTaskId(String taskId);

	@Select("select * from TBL_CIRCULATION where CYID = #{cyid}")
	TblCirculationMySql findById(String cyid);

	@InsertProvider(method = "saveTblCirculation",type =TblCirculationMySqlMapperSqlConfig.class )
	@Options(useGeneratedKeys=true, keyProperty="cyid", keyColumn="CYID")
    void saveTblCirculation(TblCirculationMySql c);

	@Select("select * from TBL_CIRCULATION where TASKID = #{contractId}")
	TblCirculationMySql getOneBytaskid(String contractId);
}
